package com.company.Selectsort;

public class Selectsort {

    public static void main(String[] args) {

        int[] arrs = {112,34,234,12,34,23,1,2};

        sort(arrs);

        for (int arr : arrs) {

            System.out.println(arr);
        }

    }

    public static void sort(int[] arrs)
    {

        for (int count = 0; count < arrs.length - 1; count++)
        {
            int minindex = count;

            for (int a = count + 1 ; a < arrs.length ; a++)
            {
                if (arrs[a] < arrs[minindex])
                {
                    minindex = a;
                }
            }

            int lingshi = arrs[count];

            arrs[count] = arrs[minindex];

            arrs[minindex] = lingshi;

        }


    }

}



